home *** CD-ROM | disk | FTP | other *** search
/ Floppyshop 2 / Floppyshop - 2.zip / Floppyshop - 2.iso / art&graf.ix / art-3485 / art-5570 / atsirds.txt < prev    next >
Text File  |  1994-08-11  |  8KB  |  181 lines

  1.          AtSIRDS -- Creating stereograms with the Atari ST/TT/Falcon
  2.          ===========================================================
  3.  
  4.       )C( Copyleft 8/1994 Christian Perle <incp@sun.rz.tu-clausthal.de>
  5.  
  6.                   (Original SIRDS routine by W.A. Steer)
  7.  
  8.  
  9. INTRO
  10. -----
  11. The first time I ever heard of SIRDS (Single Image Random Dot Stereograms), 
  12. I thought "This is bulls**t, no-one can see them". A friend of mine gave me 
  13. a black/white print and what I saw was random pixels all over the paper. 
  14. "You have to look _behind_ the picture to see the image", he said, but I 
  15. still couldn't see it.
  16.  
  17. A few months later I was clicking around in Mosaic and found some SIRDS 
  18. pages. "Oh no, not again", I thought, and just for fun I looked at a very 
  19. chaotic picture. Then I saw it. The 3-D object literally jumped me in the 
  20. eye. "These things are getting interesting", I thought and immediately 
  21. searched a few ftp archives for SIRDS maker programs. There were many of 
  22. them for DOS, a few for Amiga and Unix, and not a single one for Atari.
  23.  
  24. Fortunately, I found a SIRDS FAQ list, with an excellent C source for 
  25. making high quality SIRDS. I have rewritten the program in GFA basic -- not 
  26. the best choice, I know -- but added file handling which was not present 
  27. in the original code.
  28.  
  29.  
  30. WHAT IS SIRDS/SIS?
  31. ------------------
  32. SIRDS are a method to encode depth information in a single image. A random 
  33. pattern is repeated over each line of the image. When the image is watched 
  34. "cross-eyed", so that the left eye focuses on a different point than the 
  35. right eye, shifts in the pattern can create different depths. The distance 
  36. between the left/right focus point should be exactly the pattern width. In 
  37. order to see the depth more easily, I have added two "help marks" showing 
  38. this width at the top of the image. Shift them until you see three marks. 
  39. On more information how to see SIRDS, read the SIRDS FAQ list.
  40.  
  41. SIS is basically the same as SIRDS, but the pattern is not random. There 
  42. must be a picture file which is tiled across the image to create the 
  43. pattern. SIS stereograms are sometimes easier to see. A SIS program is 
  44. included in this package.
  45.  
  46.  
  47. IMPORTANT
  48. ---------
  49. You need to have the GFA basic interpreter 3.x to run the programs listed 
  50. below.
  51.  
  52.  
  53. FILES
  54. -----
  55. CAR.IMG         ready-to-watch SIRDS image (for those who can't wait)
  56. ATSIRDS.LST     main SIRDS program, writes TGA output file
  57. ATSIRDSM.LST    SIRDS program, monochrome only version
  58. ATSIRDSS.LST    SIRDS program, monochrome only, single depth version
  59. ATSIS.LST       main SIS program, writes TGA output file
  60. SIRDS.PI3       single depth data for ATSIRDSS
  61. AGATTILE.POV    POV-Ray scene for tile picture
  62. BOZOTILE.POV    POV-Ray scene for tile picture
  63. CARTILE.POV     POV-Ray scene for tile picture
  64. DEPTH1.POV      POV-Ray scene for depth data
  65. DEPTH2.POV      POV-Ray scene for depth data
  66. DEPTH3.POV      POV-Ray scene for depth data
  67. DEPTH4.POV      POV-Ray scene for depth data
  68. DEPTH5.POV      POV-Ray scene for depth data
  69. DEPTH1.RED      POV-created depth data for SIRDS/SIS
  70. DEPTH2.RED      POV-created depth data for SIRDS/SIS
  71. DEPTH3.RED      POV-created depth data for SIRDS/SIS
  72. DEPTH4.RED      POV-created depth data for SIRDS/SIS
  73. BOZOTILE.TGA    POV-created tile picture for SIS
  74. CARTILE.TGA     POV-created tile picture for SIS
  75. ATSIRDS.TXT     this file
  76.  
  77.  
  78. GENERATING SIRDS
  79. ----------------
  80. You might want to do your first SIRDS now. Depending on the display 
  81. hardware of your Atari, you should either use ATSIRDS (for color TGA file 
  82. output) or ATSIRDSM (for monochrome display).
  83.  
  84. Both ATSIRDS and ATSIRDSM read depth data from headerless RED files. More 
  85. on this file type later. The input and ouput files are selected with the 
  86. standard Atari file selector.
  87.  
  88. ATSIRDSM just creates two color SIRDS (black and white) and displays the 
  89. result on the screen. When finished, the SIRDS image can be saved as 32000 
  90. byte screen format.
  91.  
  92. ATSIRDS just produces an output file and displays nothing but processing 
  93. info. The output file is an uncompressed true color TGA, so it's quite big. 
  94. The number of colors in the TGA is controlled by setting the numcolors% 
  95. variable in the program. The program will create a grey palette of the 
  96. specified size. Values for numcolors% range from 2 to 256. Regardless of 
  97. the actual number of colors, the TGA will always be 24 bit true color, so 
  98. post processing is needed to reduce the file size. I recommend GEM-View, an 
  99. excellent shareware program for this task.
  100.  
  101. A very powerful feature of ATSIRDS is the so-called oversampling. Most of 
  102. the objects in two colors SIRDS appear as parallel planes, so they look 
  103. sliced in the Z (depth) direction. The only way to get around this is to 
  104. use more colors and calculate each pixel as two, four or six sub-pixels, 
  105. giving the pixel the average color of all sub-pixels. The oversampling 
  106. ratio and the number of colors are related. A rule of thumb is
  107.   numcolors% >= 2^oversam%
  108. so you would use at least 16 colors for an oversampling ratio of 4. Values 
  109. for oversam% are 1, 2, 4 and 6. The oversampling ratio 1 implies no 
  110. oversampling.
  111.  
  112. There is another variable dohiddenrem! which enables hidden point removal, 
  113. if set TRUE. However, the effect is minimal, so save processor time and 
  114. leave it set to FALSE.
  115.  
  116. The variables xres% and yres% are the resolution of the depth data file. 
  117. The resulting output file has ten more lines, which contain the "help 
  118. marks".
  119.  
  120.  
  121. GENERATING SIS
  122. --------------
  123. The program ATSIS is used for this type of stereograms. Depth data is read 
  124. from a RED file and the tile picture is read from a TGA file. There is no 
  125. numcolors% because the tile picture is always true color.
  126.  
  127. The variables txr% and tyr% are the resolution of the tile picture. The 
  128. txr% should always be 96, because this is the pattern width.
  129.  
  130. Using the right tile pictures can create the most beautiful looking 
  131. stereograms, far better that random dots. The TGA output of ATSIS looks 
  132. best in true color or dithered to 256 colors.
  133.  
  134.  
  135. GENERATING SIRDS WITH SINGLE DEPTH
  136. ----------------------------------
  137. I have added the program ATSIRDSS for making flat objects from monochrome 
  138. Degas PI3 files. Black pixels in the Degas file will be floating above the 
  139. background. The result is displayed on the screen and can be saved as 32000 
  140. byte screen format.
  141.  
  142.  
  143. USING POV-RAY TO CREATE DEPTH DATA
  144. ----------------------------------
  145. Most of the input data for SIRDS is created by 3-D rendering programs. 
  146. ATSIRDS/SIS is suited for using the output of POV-Ray, a superb free 
  147. raytracer. Both depth data and tile pictures can be created with POV-Ray.
  148.  
  149. To render depth data with POV-Ray, use the parameters:
  150.  
  151. povray +iDEPTH5.POV +oDEPTH5 +w640 +h470 +fr
  152.                                          ^^^
  153.                                   raw format, important!
  154.  
  155. This will create three files: DEPTH5.RED, DEPTH5.GRN and DEPTH5.BLU.
  156. Because the scene is greyscale, files DEPTH5.GRN and DEPTH5.BLU can be 
  157. removed (red, green and blue parts contain the same information). Use 
  158. DEPTH5.RED with ATSIRDS/SIS.
  159.  
  160. For those who are familiar with POV-Ray:
  161. All objects in the scene are ambient lighted. There is no light source. The 
  162. camera looks straight into Z direction. The objects must me placed in a 
  163. white/black gradient texture in front of the camera. If an object is placed 
  164. closer to the camera, it gets brighter. If it is placed far, it gets 
  165. darker. The problem is to fit all objects into one white/black range 
  166. (remember the gradient repeats). In scene DEPTH5.POV, there are two camera 
  167. declarations: One for normal view and depth data output, and one from the 
  168. side for checking if the objects are placed right.
  169.  
  170.  
  171. USING POV-RAY TO CREATE TILE PICTURES
  172. -------------------------------------
  173. To render a tile picture with POV-Ray, use the parameters:
  174.  
  175. povray +iAGATTILE.POV +oAGATTILE.TGA +w96 +h470 +ft
  176.  
  177.  
  178.  
  179. That's it.
  180. Have fun with ATSIRDS!
  181.